package oa.dao.impl;

import java.util.List;

import oa.base.BaseDao;
import oa.dao.LoginDao;
import oa.entity.Login;
import oa.exception.DaoException;

public class LoginDaoImpl extends BaseDao<Login> implements LoginDao {

	/**
	 * 管理员登录
	 */
	@Override
	public Login loginCheck(String name, String pwd) {
		
		List<Login> list = null;
		try {
			list = executeQuery("SELECT * FROM login WHERE login_name=? and login_pwd = ?", name, pwd);
			if(list!=null&&list.size()!=0){
				return list.get(0);
			}
		} catch (DaoException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

}
